Return to start page

Systems/Character/Struct View.j

Code

		
1			/// Do not use this library, it is unfinished!
2 library AStructSystemsCharacterView requires AStructCoreGeneralHashTable, AStructCoreInterfaceThirdPersonCamera, ALibraryCoreMathsUnit, AStructSystemsCharacterAbstractCharacterSystem
3
4 struct AView extends AAbstractCharacterSystem
5
6 //methods
7
8 public method enable takes nothing returns nothing
9 call super.enable()
10 if (AThirdPersonCamera.playerThirdPersonCamera(this.character().user()).unit() != this.character().unit()) then
11 call AThirdPersonCamera.playerThirdPersonCamera(this.character().user()).enable(this.character().unit(), 0.0)
12 else
13 call AThirdPersonCamera.playerThirdPersonCamera(this.character().user()).resume()
14 endif
15 endmethod
16
17 public method disable takes nothing returns nothing
18 call super.disable()
19 call AThirdPersonCamera.playerThirdPersonCamera(this.character().user()).pause()
20 endmethod
21
22 public static method create takes ACharacter character returns thistype
23 local thistype this = thistype.allocate(character)
24 call AThirdPersonCamera.playerThirdPersonCamera(this.character().user()).enable(character.unit(), 0.0)
25 return this
26 endmethod
27
28 public method onDestroy takes nothing returns nothing
29 call AThirdPersonCamera.playerThirdPersonCamera(this.character().user()).disable()
30 endmethod
31 endstruct
32
33 endlibrary